# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=libpsl-native
pkgver=7.3.1
pkgrel=0
pkgdesc="This library provides functionality missing from .NET Core via system calls"
arch="all"
url="https://github.com/PowerShell/PowerShell-Native"
license="MIT"
makedepends="
	cmake
	gtest-dev
	samurai
	"
source="
	$pkgname-$pkgver.tar.gz::https://github.com/PowerShell/PowerShell-Native/archive/refs/tags/v$pkgver.tar.gz
	enable-testing-on-arm.patch
	fix-testing-suite.patch
	new-gtest.patch
	"
builddir="$srcdir"/PowerShell-Native-$pkgver/src/libpsl-native

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

check() {
	cd build
	ctest --output-on-failure
}

package() {
	install -Dm755 "$builddir"/../powershell-unix/libpsl-native.so "$pkgdir"/usr/lib/libpsl-native.so
}

sha512sums="
dfaabae1f6b2b057d71062574e03e6e95f60a0e26d1e4936689358294080b4e5e8cca37dec2454f4547bba8b9991d87df536f5267650d218ee04204a65bc67e1  libpsl-native-7.3.1.tar.gz
7c9dc6f13d96f7071cbfcd77c23973a48b58dd5e89cddec6884ccbafa2cc0d14e269a9582b8554c1a5a98556b7d20cf2375d958131d94d550234a41f94c06955  enable-testing-on-arm.patch
03769390757ab8abf7d31887a0cb9a3504da5e8475b2b5b8707bad570b91927ad6e743f161926a59aa85293ad1f25cf755c7d2757638328ea334b0db405dcd09  fix-testing-suite.patch
dec8d8cc2b38e256d865555f4a10eaca2bde436f37dba8dae4f223a73c69622f10c8f3497c3704a9a4b26ec3a94330196c3169130236f3f066c13a1c9c605a19  new-gtest.patch
"
